﻿using JESAI.DDD.Entities;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace JESAI.Platform.Domain.Sys.Entities
{
    [SugarTable("tb_online_field")]
    public class OnlineFieldEntity : IEntity<string>
    {
        /// <summary>
        /// 主键ID
        /// </summary>
        [SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = false)]
        public string Id { get; set; }

        /// <summary>
        /// 是否有效
        /// </summary>
        public bool IsValid { get; set; }

        /// <summary>
        /// 是否删除
        /// </summary>
        public bool IsDelete { get; set; }

        /// <summary>
        ///  创建者ID
        /// </summary>
        public long Cid { get; set; }

        /// <summary>
        ///  更新者ID
        /// </summary>
        public long Uid { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime? UpdateTime { get; set; }

        /// <summary>
        /// 字段中文名称
        /// </summary>
        public string FieldCnName { get; set; }

        /// <summary>   
        /// 字段英文名称
        /// </summary>
        public string FieldEnName { get; set; }

        /// <summary>
        /// 控件类型
        /// </summary>
        public ControlType FiledType { get; set; }

        /// <summary>
        /// 是否排序
        /// </summary>
        public bool IsOrder { get; set; }

        /// <summary>
        /// 是否查询
        /// </summary>
        public bool IsSerch { get; set; }

        /// <summary>
        /// 列表是否显示
        /// </summary>
        public bool IsTableShow { get; set; }

        /// <summary>
        /// 表单是否显示
        /// </summary>
        public bool IsFormShow { get; set; }

        /// <summary>
        /// 在线表单ID
        /// </summary>
        public string OnlineInfoId { get; set; }
    }

    /// <summary>
    /// 控件类型
    /// </summary>
    public enum ControlType
    {
        TextBox = 1,
        ComboBox = 2,
        DateTime = 3,
        Number = 4,
        TextArea = 5,
        CheckBox = 6,
        RadioButton = 7,
        FileUpload = 8,
        Password = 9,
    }
}
